import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login/index.vue'
import Layout from '@/views/Layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: Login
    },
    {
      path: '/',
      component: Layout,
      redirect: '/goods/index',
      children: [
        {
          path: '/statistics/index',
          component: () => import('@/views/Statistics/index.vue')
        },
        {
          path: '/goods/index',
          component: () => import('@/views/Goods/index.vue')
        },
        {
          path: '/inventory/index',
          component: () => import('@/views/Inventory/index.vue')
        },
        {
          path: '/order/index',
          component: () => import('@/views/Order/index.vue')
        },
        {
          path: '/user/index',
          component: () => import('@/views/User/index.vue')
        },
        {
          path: '/content/banner',
          component: () => import('@/views/Content/BannerMod.vue')
        },
        {
          path: '/content/tag',
          component: () => import('@/views/Content/TagMod.vue')
        }
      ]
    }
  ]
})

export default router
